/*
 * SpriteAnimation.h
 *
 *  Created on: 25 jan 2010
 *      Author: hule
 */

#ifndef SPRITEANIMATION_H_
#define SPRITEANIMATION_H_

#include <string>

using namespace std;

class SDL_Rect;
class Image;

class SpriteAnimation {
public:
	SpriteAnimation(int rows, int cols,int frametime, Image *pic);
	virtual ~SpriteAnimation();
	SDL_Rect getFrame();
	void update(int elapsedTime);


	bool getLoop();
    int getWidth();
    int getHeight();
    void setLoop(bool loop);

private:
	bool loop;
	int frametime;
	int duration;
	int belong;
	int current;
	int total;
	int rows,cols;
	int width, height;
};

#endif /* SPRITEANIMATION_H_ */
